Repository navigation
feat(dincli): deploy sets DinToken and defaults --model-id (task_061026_21 Part C, Deploy) - #314
Conversation
…26_21 Part C, Deploy) The deploy follow-up PR InfiniteZeroFoundation#302 deferred until InfiniteZeroFoundation#261 merged: - `model-owner deploy task-coordinator` and `task-auditor` call setDinToken(din_info token) on the new contract. Without it, `rewards deposit` refuses and no GI can be funded or started. - `--model-id` is optional. The coordinator defaults to DINModelRegistry.totalModels() (the ID the next approval assigns) and warns that this only holds if no other request is approved first. The auditor defaults to the coordinator's modelId(); the mismatch guard from InfiniteZeroFoundation#261 is unchanged. - A missing `stake` or `token` din_info entry exits with a clear message before any transaction, instead of a NameError. DINTaskCoordinator.md §10 No. 10 and DINTaskAuditor.md §13 No. 8 now describe the fixed deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… every phase task_061026_21 Part D, Decision 3. test_04_gi.py now: - funds GI 1 (model owner buys DIN, `rewards deposit`) before `gi start`; - registers each auditor's encryption key, and checks an aggregator can't also register as an auditor (task_061026_20 Part B, InfiniteZeroFoundation#180); - adds the seed and test-data states: `auditor lock-seed` (AuditSeedLocked), `create-testdataset --submit` (AuditTestDataAssigned), `aggregator lock-seed` (AggSeedLocked); - adds the three reveal windows: `start-reveal` + per-validator reveal for LMS evaluation, T1 and T2; then `T2 set-score`; - asserts the GI state by name after every phase. `_gi_state` now parses "Global iteration state: <name>" (it used to return the first non-markup line, i.e. the contract-address banner). The end state is GIended by name and ordinal 28, with no `or "23"` fallback; - claims and withdraws GI 1's reward for one client, one auditor and one aggregator, checking each DIN balance rises, then `gi release-slots`. test_02: the deploys leave --model-id to its default and check that DinToken was set on both contracts (needs InfiniteZeroFoundation#314). The deployed address is taken from the "deployed at" line, not the first 0x… line (the stake address). conftest: COLUMNS=250 for dincli subprocesses, so Rich doesn't wrap the lines the suite matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed PR No. 314 at At the last conflict check, CI OK passed. The Python job reports 843 passed, 133 deselected. Docs and Solidity jobs also passed. Claimed: Both deployment commands configure DinToken, with the auditor configured before pairing. Verified against local Anvil: Built the exact PR commit using Solidity 0.8.28 and the repository’s Transaction receipts confirmed:
All transactions succeeded. On-chain reads confirmed both token addresses, ownership, stake dependencies, and the coordinator–auditor link in both directions. Claimed: Model IDs default correctly while explicit IDs and mismatch protection remain supported. Verified: On Anvil, the coordinator default matched registry The auditor’s documented deviation from the spec is justified: reading its coordinator’s immutable ID avoids an unnecessary mismatch if another registration is approved between deployments. Claimed: Token setup enables reward funding. Verified against local Anvil: Registered the deployed model, acquired disposable test DIN, and ran: Receipts confirmed approval followed by The test used an isolated manifest cache; it did not require an IPFS service. Claimed: Missing stake/token entries fail clearly before transactions, and documentation reflects the new deployment behavior. Verified: The focused unit tests cover missing stake for both commands and missing token for the auditor, with no transactions sent. Source inspection confirms both commands use the shared required-address helper. Both documentation updates match the implementation, and the Docs check passed. Independent verification summary:
Scope and closing keywords: This completes the deployment follow-up, rather than all of task_061026_21 Part C. Neither the reviewed PR body nor its commit message contains an issue-closing directive. No actionable findings. The previously pending deployment and reward-funding verification is complete. Recommend approval and merge as-is through the normal merge queue. |
Files changed (5) — as of
|
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +62/-12 |
| Diff | Adds required-address and token-setting helpers; makes model IDs optional; configures both deployed contracts’ token addresses. |
| Functionality — how & why | How: Coordinator defaults to registry totalModels() with a warning. Auditor defaults to coordinator modelId(), retains mismatch refusal, and sets its token before pairing. Why: Completes deployment setup for rewards/bonds and rejects missing stake/token configuration before transactions. |
Diff vs current develop HEAD |
Untouched since merge-base at the last check. |
| Recommended merge proposal | Merge as-is. Actual CLI deployments, transaction order, token setup, pairing, ID handling, and reward funding passed on Anvil. |
| Actual merge proposal | Soon |
| Pending proposal | None. |
| Local merge conflict | No |
| GitHub merge conflict | No |
tests/test_deploy_task_contracts.py
| Field | Value |
|---|---|
| Change | New |
| Lines | +154/-0 |
| Diff | Adds eight deployment tests. |
| Functionality — how & why | How: Records mocked constructor arguments and transaction order; exercises defaults and missing-address failures. Why: Provides repeatable unit coverage of deployment setup. |
Diff vs current develop HEAD |
File absent on develop at the last check. |
| Recommended merge proposal | Merge as-is; all eight tests pass. Actual deployment behavior was also checked on Anvil. |
| Actual merge proposal | Soon |
| Pending proposal | None. |
| Local merge conflict | No |
| GitHub merge conflict | No |
tests/test_task_auditor_model_id_guard.py
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +7/-3 |
| Diff | Updates mocks for deployed-contract addresses, token setup, and the context signature. |
| Functionality — how & why | How: Supplies dependencies required by the updated deployment. Why: Preserves the existing model-ID mismatch regression coverage. |
Diff vs current develop HEAD |
Untouched since merge-base at the last check. |
| Recommended merge proposal | Merge as-is; both tests pass. Anvil also confirmed that an explicit mismatch sends no transaction. |
| Actual merge proposal | Soon |
| Pending proposal | None. |
| Local merge conflict | No |
| GitHub merge conflict | No |
Documentation/technical/contracts/DINTaskCoordinator.md
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +2/-2 |
| Diff | Replaces the stale deployment caveat and documents automatic token setup. |
| Functionality — how & why | How: Describes the current constructor, default ID, and approval-order warning. Why: Aligns documentation with the deployment command. |
Diff vs current develop HEAD |
Untouched since merge-base at the last check. |
| Recommended merge proposal | Merge as-is; consistent with implementation and observed Anvil behavior. Docs CI passes. |
| Actual merge proposal | Soon |
| Pending proposal | None. |
| Local merge conflict | No |
| GitHub merge conflict | No |
Documentation/technical/contracts/DINTaskAuditor.md
| Field | Value |
|---|---|
| Change | Modified |
| Lines | +1/-1 |
| Diff | Replaces the stale constructor caveat with current deployment behavior. |
| Functionality — how & why | How: Documents the three-argument constructor, coordinator-derived ID, mismatch refusal, and token-before-pairing ordering. Why: Aligns documentation with the deployment command. |
Diff vs current develop HEAD |
Untouched since merge-base at the last check. |
| Recommended merge proposal | Merge as-is; consistent with implementation and observed Anvil behavior. Docs CI passes. |
| Actual merge proposal | Soon |
| Pending proposal | None. |
| Local merge conflict | No |
| GitHub merge conflict | No |
Verification
CI is green at 24be72b. Independent focused tests report 43 passed, and the actual deployment/reward-funding smoke run on remote Anvil reports 21 checks passed. No code changes or additional verification are requested for this deployment scope.
Santiagocetran
left a comment
There was a problem hiding this comment.
Verified 24be72b: CI is green, 43 focused tests pass, and a fresh Anvil run passed 21 checks covering actual CLI deployments, token setup, matching model IDs, contract pairing, mismatch refusal, and reward funding. The auditor’s coordinator-derived model-ID default is justified. No actionable findings; approve as-is.
ad94870
|
Post-merge CI passed on |
Actual outcome — PR #314 merged as-is (pushed)This supersedes the pre-merge review comment above with what actually happened. One commit on
No deviation commit was needed. Files unchanged from the PR (5 of 5)
None of the five has been touched on VerificationPost-merge checks on Local vs. GitHub agree: clean merge, as both predicted. |
Summary
task_061026_21 Part C, Deploy: the follow-up that #302 deferred until #261 merged. Spec:
Developer/tasks/task_061026_21.md(Deploy, BL-27). Tracking: Discussion #231.Part D (#313) depends on this. Without
setDinToken,rewards depositrefuses, so the integration suite can't fund or start a GI.Changes (
dincli/cli/modelownerd/deploy.py)setDinToken:deploy task-coordinatoranddeploy task-auditoreach callsetDinToken(din_info token)on the new contract. The auditor does this beforesetDINTaskAuditorContract.--model-idis optional:DINModelRegistry.totalModels(), the 0-based ID the next approval assigns. It prints a warning that the guess only holds if no other request is approved first.modelId(). The mismatch guard from feat(cache_model_0): refresh task-contract ABIs from foundry and fix deploy constructors (BL-25) #261 is unchanged.NameErroris fixed: a missingstakeortokendin_info entry now exits with a clear message before any transaction is sent.Docs:
DINTaskCoordinator.md§10 No. 10 andDINTaskAuditor.md§13 No. 8 had said dincli still used the pre-modelIdconstructors, which has been wrong since #261. They now describe the deploy as it is.For review
totalModels(). For the auditor, I default to the coordinator'smodelId()instead. If another approval landed between the two deploys,totalModels()would move, and the auditor would then refuse its own coordinator.Tests
tests/test_deploy_task_contracts.py(8 tests) covers:setDinToken(→setDINTaskAuditorContract)stakeortokenexits before any txtest_task_auditor_model_id_guard.py: its mocks now take the address argument and a token entry.🤖 Generated with Claude Code